// 
//  index.js
//  <project>
//	每个发出tip的锚点必须有data-make-code="false",data-qrcode-content="xxx"两个属性
//	如 <span data-make-code="false" data-qrcode-content="xxx">anchor</span>
//  Created by Administrator on 2017-11-27.
//  Copyright 2017 Administrator. All rights reserved.
// 

define(['./qrcode-handler', 'knockout', 'jquery'], function(qrcodeHandler, ko, $) {
	var exam01Str = 'hello world';
	var exam02Str = exam01Str;
	var exam03Str = ko.observable("");
	return {
		exam01Str: exam01Str,
		exam02Str: exam02Str,
		exam03Str: exam03Str,
		changeTextExam03: function(obj, event) {
			this.exam03Str($(event.target).data('qrcode-content'));
		},
		attached: function() {
			qrcodeHandler.makeHoverQrcode({
				selector: '.anchor1',
				text: exam01Str,
				width: 200,
				height: 200,
				position: 'right',
				deltaX:200,
			});
			qrcodeHandler.makeHoverQrcode({
				selector: '.anchor2',
				width: 200,
				height: 200,
				position: 'right'
			});
			qrcodeHandler.makeHoverQrcode({
				selector: '.anchor3',
				width: 200,
				height: 200,
				position: 'right',
				getNewContent: function() {
					return exam03Str();
				}
			});
			qrcodeHandler.makeHoverQrcode({
				selector: '.anchor4',
				width: 200,
				height: 200,
				position: 'right'
			});
		}
	};
})